package com.test.service;

import java.util.List;

import com.test.dao.CardTypeDAO;
import com.test.entity.CardType;

public class CardTypeService {
	private CardTypeDAO cardTypeDAO;

	public List<CardType> queryCardType() {

		return cardTypeDAO.queryCardType();
	}

	public List<CardType> queryCardTypeID(int cid) {
		List<CardType> listid = cardTypeDAO.queryCarid(cid);
		List<CardType> listnameCardTypes = null;
		if (listid.get(0).getCardTypeName() != null) {
			String cardnameString = listid.get(0).getCardTypeName();
			String car = cardnameString.substring(0, 1);
			listnameCardTypes = cardTypeDAO.queryCardName(car);
		}
		return listnameCardTypes;
	}

	public List<CardType> queryCardName(String cardname) {
		return cardTypeDAO.queryCardName(cardname);
	}

	public List<Object[]> queryBySeleQuantity() {
		return cardTypeDAO.queryBySeleQuantity();
	}

	public CardTypeDAO getCardTypeDAO() {
		return cardTypeDAO;
	}

	public void setCardTypeDAO(CardTypeDAO cardTypeDAO) {
		this.cardTypeDAO = cardTypeDAO;
	}

}
